﻿@{
    ViewBag.Title = "数据库备份";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var dataBaseLinkId = request('dataBaseLinkId');
    var keyValue = request('keyValue');
    $(function () {
        initControl();
    })
    //初始化控件
    function initControl() {
        //执行方式
        $("#F_ExecuteMode").ComboBox({
            description: "==请选择==",
            height: "160px"
        });
        //执行时间
        $("#F_ExecuteTime").ComboBox({
            description: "==请选择==",
            height: "120px"
        });
        //获取表单
        if (!!keyValue) {
            $.SetForm({
                url: "../../SystemManage/DataBaseBackup/GetFormJson",
                param: { keyValue: keyValue },
                success: function (data) {
                    var ExecuteTime = data.F_ExecuteTime;
                    data.F_ExecuteTime = "";
                    $("#form1").SetWebControls(data);
                    $("#F_ExecuteTime").ComboBoxSetValue(ExecuteTime.substring(0, 2));
                }
            });
        } else {
            $("#F_DatabaseLinkId").val(dataBaseLinkId);
        }
    }
    //保存表单
    function AcceptClick() {
        if (!$('#form1').Validform()) {
            return false;
        }
        var postData = $("#form1").GetWebControls(keyValue);
        postData["F_ExecuteTime"] = postData["F_ExecuteTime"] + ":00";
        $.SaveForm({
            url: "../../SystemManage/DataBaseBackup/SaveForm?keyValue=" + keyValue,
            param: postData,
            loading: "正在保存数据...",
            success: function () {
                $.currentIframe().$("#gridTable").trigger("reloadGrid");
            }
        })
    }
</script>
<div style="margin: 5px;">
    <div class="alert alert-warning" style="margin-bottom: 5px; overflow: hidden;">
        <div style="float: left"><i class="fa fa-question-circle" style="position: relative; top: 1.5px; font-size: 15px; padding-right: 10px;"></i>注意：</div>
        <div style="float: left">
            1、使用备份功能的用户需要有数据库的dbo权限<br />
            2、备份路径必需是在数据库服务器中存在的路径
        </div>

    </div>
</div>
<div style="margin-top: 5px; margin-right: 30px;">
    <input id="DatabaseLinkId" type="hidden" />
    <table class="form">
        <tr>
            <th class="formTitle">计划编号<font face="宋体">*</font></th>
            <td class="formValue">
                <input id="F_EnCode" type="text" class="form-control" placeholder="请输入编号" isvalid="yes" checkexpession="NotNull" />
            </td>
        </tr>
        <tr>
            <th class="formTitle">计划名称<font face="宋体">*</font></th>
            <td class="formValue">
                <input id="F_FullName" type="text" class="form-control" placeholder="请输入名称" isvalid="yes" checkexpession="NotNull" />
            </td>
        </tr>
        <tr>
            <th class="formTitle">执行方式<font face="宋体">*</font></th>
            <td class="formValue">
                <div id="F_ExecuteMode" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull">
                    <ul>
                        <li data-value="0">每天</li>
                        <li data-value="1">每周一</li>
                        <li data-value="2">每周二</li>
                        <li data-value="3">每周三</li>
                        <li data-value="4">每周四</li>
                        <li data-value="5">每周五</li>
                        <li data-value="6">每周六</li>
                        <li data-value="7">每周日</li>
                    </ul>
                </div>
            </td>
        </tr>
        <tr>
            <th class="formTitle">执行时间<font face="宋体">*</font></th>
            <td class="formValue">
                <div id="F_ExecuteTime" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull">
                    <ul>
                        <li data-value="00">00:00</li>
                        <li data-value="01">01:00</li>
                        <li data-value="02">02:00</li>
                        <li data-value="03">03:00</li>
                        <li data-value="04">04:00</li>
                        <li data-value="05">05:00</li>
                        <li data-value="06">06:00</li>
                        <li data-value="07">07:00</li>
                        <li data-value="08">08:00</li>
                        <li data-value="09">09:00</li>
                        <li data-value="10">10:00</li>
                        <li data-value="11">11:00</li>
                        <li data-value="12">12:00</li>
                        <li data-value="13">13:00</li>
                        <li data-value="14">14:00</li>
                        <li data-value="15">15:00</li>
                        <li data-value="16">16:00</li>
                        <li data-value="17">17:00</li>
                        <li data-value="18">18:00</li>
                        <li data-value="19">19:00</li>
                        <li data-value="20">20:00</li>
                        <li data-value="21">21:00</li>
                        <li data-value="22">22:00</li>
                        <li data-value="23">23:00</li>
                    </ul>
                </div>
            </td>
        </tr>
        <tr>
            <th class="formTitle">备份路径<font face="宋体">*</font></th>
            <td class="formValue">
                <input id="F_BackupPath" type="text" class="form-control" placeholder="请输入路径" isvalid="yes" checkexpession="NotNull" />
            </td>
        </tr>
        <tr>
            <th class="formTitle" valign="top" style="padding-top: 4px;">描述</th>
            <td class="formValue">
                <textarea id="F_Description" class="form-control" style="height: 70px;"></textarea>
            </td>
        </tr>
    </table>
</div>

